<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<style>
:not(.x).a + #b { background-color: green }
</style>
<div id="a"></div>
<div id="b"></div>
<script>
description("Negated selector should not clear adjacent combinator flag.")

var transparent = "rgba(0, 0, 0, 0)";
var green = "rgb(0, 128, 0)";

shouldBe("getComputedStyle(b).backgroundColor", "transparent");

a.offsetTop; // Force recalc.
a.className = "a";

if (window.internals)
    shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
else
    a.offsetTop; // Force recalc (crbug.com/436064)

shouldBe("getComputedStyle(b).backgroundColor", "green");
</script>
